package com.ruoyi.course.service.impl;

import java.util.List;
        import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.course.mapper.CourseTrainMapper;
import com.ruoyi.course.domain.CourseTrain;
import com.ruoyi.course.service.ICourseTrainService;

/**
 * course_trainService业务层处理
 *
 * @author zzx
 * @date 2023-03-29
 */
@Service
public class CourseTrainServiceImpl implements ICourseTrainService {
    @Autowired
    private CourseTrainMapper courseTrainMapper;

    /**
     * 查询course_train
     *
     * @param id course_train主键
     * @return course_train
     */
    @Override
    public CourseTrain selectCourseTrainById(Long id) {
        return courseTrainMapper.selectCourseTrainById(id);
    }

    /**
     * 查询course_train列表
     *
     * @param courseTrain course_train
     * @return course_train
     */
    @Override
    public List<CourseTrain> selectCourseTrainList(CourseTrain courseTrain) {
        return courseTrainMapper.selectCourseTrainList(courseTrain);
    }

    /**
     * 新增course_train
     *
     * @param courseTrain course_train
     * @return 结果
     */
    @Override
    public int insertCourseTrain(CourseTrain courseTrain) {
                courseTrain.setCreateTime(DateUtils.getNowDate());
            return courseTrainMapper.insertCourseTrain(courseTrain);
    }

    /**
     * 修改course_train
     *
     * @param courseTrain course_train
     * @return 结果
     */
    @Override
    public int updateCourseTrain(CourseTrain courseTrain) {
        return courseTrainMapper.updateCourseTrain(courseTrain);
    }

    /**
     * 批量删除course_train
     *
     * @param ids 需要删除的course_train主键
     * @return 结果
     */
    @Override
    public int deleteCourseTrainByIds(Long[] ids) {
        return courseTrainMapper.deleteCourseTrainByIds(ids);
    }

    /**
     * 删除course_train信息
     *
     * @param id course_train主键
     * @return 结果
     */
    @Override
    public int deleteCourseTrainById(Long id) {
        return courseTrainMapper.deleteCourseTrainById(id);
    }

    @Override
    public List<CourseTrain> selectCourseTrainListAll(CourseTrain courseTrain) {
        return courseTrainMapper.selectCourseTrainListAll(courseTrain);
    }
}
